/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package do_.com.bpd.business.referrals.referralservermanager;

import javax.ejb.Singleton;
import javax.ejb.LocalBean;

/**
 *
 * @author Administrator
 */
@Singleton
@LocalBean
public class Installer {

    private static String checkInterval = "";
    private static String dateFormat = "";
    public static String statusCodes = "";
    public static String updateFileSchema = "";

    public Installer() {
        
        Installer.checkInterval = String.valueOf(1 * 1000);
        Installer.statusCodes = "CA,AC,RE,PC";
        Installer.dateFormat = "dd/MM/yyyy";
        //Installer.updateFileSchema
        
//        try {
//            Logger.getLogger(Installer.class.getName()).info("Installing ReferralServerManager");
//            ConfigBridge cb = new ConfigBridge();
//            String packageUri = "do_/com/bpd/business/referrals/referralservermanager";
//
//            //Configure some defaults
//            Installer.checkInterval = cb.getConfiguration(packageUri + "/checkFilesInterval");
//            if (Installer.checkInterval.isEmpty()) {
//                cb.setConfiguration(packageUri + "/checkFilesInterval", String.valueOf(1 * 1000));
//                Installer.checkInterval = String.valueOf(1 * 1000);
//            }
//            
//            Installer.statusCodes = cb.getConfiguration(packageUri + "/status_signals");
//            if (Installer.statusCodes.isEmpty()) {
//                cb.setConfiguration(packageUri + "/status_signals", "CA,AC,RE,PC");
//                Installer.statusCodes = "CA,AC,RE,PC";
//            }
//
//            Installer.dateFormat = cb.getConfiguration(packageUri + "/dateFormat");
//            if (Installer.dateFormat.isEmpty()) {
//                cb.setConfiguration(packageUri + "/dateFormat", "dd/MM/yyyy");
//                Installer.dateFormat = "dd/MM/yyyy";
//            }
            
            
//            Installer.updateFileSchema = cb.getConfiguration(packageUri + "/update_file_schema");
//            if (Installer.updateFileSchema.isEmpty()) {
//                Map<String, String> schemaMap = new TreeMap();
//                schemaMap.put("", packageUri);
//                
//                cb.setConfiguration(packageUri + "/update_file_schema", schema);
//                Installer.updateFileSchema = schema;
//            }
            

//
//        } catch (Exception_Exception ex) {
//            Logger.getLogger(Installer.class.getName()).log(Level.SEVERE, "Fail instalation of ReferralServerManager. Perhaps database connection issues", ex);
//        }
    }
}
